/**
 * MIT License
 * <p>
 * Copyright (c) 2017-2018 nuls.io
 * <p>
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * <p>
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * <p>
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package io.nuls.basisi.jpa;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;

@MappedSuperclass
public abstract class BaseEntity implements Serializable {
    public static final String MARK_DELETE_Y = "Y";
    public static final String MARK_DELETE_N = "N";
    @Column( name = "created_date" )
    @JsonIgnore
    private Date createdDate;
    @Version
    @Column( name = "version_id" )
    @JsonIgnore
    private Integer versionId;
    @Column( name = "CREATED_USER", columnDefinition = "varchar(50) COMMENT '创建人'" )
    @JsonIgnore
    private String createdUser;
    @Column( name = "UPDATED_DATE" )
    @JsonIgnore
    private Date updatedDate;
    @Column( name = "MODIFIED_USER", columnDefinition = "varchar(50) COMMENT '修改人'" )
    @JsonIgnore
    private String modifiedUser;
    @Column( name = "MARK_DELETE", columnDefinition = "char(1) COMMENT '删除标志'", length = 1 )
    @JsonIgnore
    private String markDelete;

    public BaseEntity() {
    }

    public void setCreatedDate(final Date createdDate) {
        this.createdDate = createdDate;
    }

    public void setVersionId(final Integer versionId) {
        this.versionId = versionId;
    }

    public void setCreatedUser(final String createdUser) {
        this.createdUser = createdUser;
    }

    public void setUpdatedDate(final Date updatedDate) {
        this.updatedDate = updatedDate;
    }

    public void setModifiedUser(final String modifiedUser) {
        this.modifiedUser = modifiedUser;
    }

    public void setMarkDelete(final String markDelete) {
        this.markDelete = markDelete;
    }

    public Date getCreatedDate() {
        return this.createdDate;
    }

    public Integer getVersionId() {
        return this.versionId;
    }

    public String getCreatedUser() {
        return this.createdUser;
    }

    public Date getUpdatedDate() {
        return this.updatedDate;
    }

    public String getModifiedUser() {
        return this.modifiedUser;
    }

    public String getMarkDelete() {
        return this.markDelete;
    }
}
